// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router'
import DraftBox from '@/views/create/DraftBox.vue'
import Draft from '@/views/create/Draft.vue'
import Content from "@/views/create/Content.vue";

const routes = [
    {
        path: '/draftBox',
        name: 'DraftBox',
        component: DraftBox
    },

    {
        path: '/draft',
        name: 'Draft',
        component: Draft,
        meta: { hideNavbar: true }
    },
    {
        path: '/draft/edit',
        name: 'EditDraft',
        component: Draft,
        props: route => ({ draftId: route.query.draftId }),
        meta: { hideNavbar: true }
    },
    {
        path: '/content',
        name: 'Content',
        component: Content,
    },
]

const router = createRouter({
    history: createWebHistory('/'), // 直接写 '/' 即可
    routes
})

export default router